#ifndef TIME_h
#define TIME_h

#include "stm32f10x.h" 

typedef struct
{
	int on;
	int time;
	void (*timeout)(void);
}softtimer_t;


extern softtimer_t timer;


#define Delay_ms	TIM2_Delay_ms
#define Delay_us	TIM2_Delay_us

void TIM2_Delay_INit(void);
void TIM2_Delay_ms(u16 ms);
void TIM2_Delay_us(u16 us);


void timer_start(int time,void (*timeout)(void));

#endif
